 <?php


Class Catalog_IndexView Extends Yapary_MVC_View
{
	const NEWLINE = "\n";


    public function defaultView (array $arrVar)
    {
    	$output 		= NULL;
    	$option			= '';

    	// Auszugebende Daten im entsprechenden Registry-Eintrag speichern
    	$registry = Yapary_SingletonRegistry::getInstance();

    	/* @var $oSql Yapary_Db_Sql_Connector */
    	$oSql = $registry->oSql;
    	/* @var $model Index_IndexModel */
    	$model = $this->model; // Durch @var-Definition Eclipse Autocomplete nutzen!
    	/* @var $oHeader Yapary_Header_Header */
    	$oHeader = $registry->oHeader;
    	/* @var $oMetaTag Yapary_Header_MetaTag */
    	$oMetaTag = $registry->oMetaTag;
    	/* @var $oMainMenu Yapary_Menu_XmlMenu */
    	$oMainMenu = $registry->oMainMenu;
    	/* @var $oFooterMenu Yapary_Menu_XmlMenu */
    	$oFooterMenu = $registry->oFooterMenu;


    	// HTML Head Title
    	$oHeader->setTitle('Katalog');

    	// MainMenu
		$oMainMenu->setSelected(strtoupper(Yapary_SingletonRegistry::getInstance()->routeName));
    	$oMainMenu->expand('ACCOUNT_INDEX');

		// FooterMenu
		$oFooterMenu->setSelected(strtoupper(Yapary_SingletonRegistry::getInstance()->routeName));


		// CONTENT
		$oComponent = new Yapary_Form_Component();
		$oContainer = new Yapary_Form_Container();

		$oResult = $oSql->request("SELECT * FROM rubrik");
		while ($row = $oResult->getNext()) {
			$option .= '<li>
							<a href="catalog/product_'.$row->RubrikId.'"><img src="frontend/img/dummy.png" alt="PDF" /></a><br />
							<a href="catalog/product_'.$row->RubrikId.'">'.$row->Name.'</a>
						</li>';
		}
		$output .= '<h1>Produktauswahl</h1>
					<div class="listing">
						<ul>'.$option.'</ul>
					</div>'; 
		
		// Daten in globaler Registry speichern, um diese in "layout.phtml" ausgeben zu koennen
		$registry->header		= $this->partial->insert('headerData.phtml');
		$registry->mainMenu		= '';
		$registry->content		= $this->partial->insert('contentData.phtml', array('content_mid' => $output));
    	$registry->footerMenu	= $oFooterMenu->display();
    }

}

?>
